package edu.jd.movieplatform.user.comment.dao;

import edu.jd.movieplatform.user.comment.Comment;
import edu.jd.movieplatform.user.comment.CommentDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @descriptions:
 * @data: 2021/7/9 22:58
 */
public interface CommentDao {
    boolean createComment(CommentDto dto);

    @Select("select ifnull(max(comment_host_id),0)+1 from comment")
    Integer findCommentNewNum();
    @Select("select max(comment_sub_id)+1 from comment where comment_host_id=#{comment_host_id}")
    Integer findReplyNewNum(Integer comment_host_id);

    List<Comment> getHostCommentList(Integer mov_id);

    List<Comment> getSubCommentList(Integer mov_id, Integer comment_host_id);
}
